using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DocManager
{
    public partial class FrmUserModify : Form
    {
        User _user;

        public User user
        {
            get { return _user; }
            set { _user = value; }
        }
        public FrmUserModify()
        {
            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
        }

        public FrmUserModify(User User)
        {
            InitializeComponent();
            _user = User;
            txtCode.Text = _user.user_code;
            txtName.Text = _user.user_name;
            txtPwd.Text = _user.user_pwd;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (_user == null)
                _user = new User();
            _user.user_code = txtCode.Text;
            _user.user_name = txtName.Text;
            _user.user_pwd = txtPwd.Text;
            this.DialogResult = DialogResult.OK;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}